﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using BusinessObject;
using BusinessLayer;

namespace RestHouseReservation
{
    public partial class ReserveRoom : System.Web.UI.Page
    {
        public string Display = "";
       // public string session = "";
        public static bool Result = true;
        ReservationLogic Logic = new ReservationLogic();
        protected void Page_Load(object sender, EventArgs e)
        {
           
        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            ReservationDao Reservation = new ReservationDao();
            Reservation.CheckIn = TextBox1.Text;
            Reservation.CheckOut = TextBox2.Text;
            Reservation.PaNumber = Session["PaNumber"].ToString();
            Reservation.RoomType = DropDownList1.SelectedValue;
            Result = Logic.ReserveRoom(Reservation);
            if (Result)
            {
                Server.Transfer("UserPage.aspx");
            }
            else
            {
                Display = "Wrong Date Entered , Please Try Again...!!!";
            }
        }
    }
}